<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>flower-nav</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background: black;
            overflow: hidden;
        }

        #nav {
            position: relative;
            width: 130px;
            height: 400px;
        }

        #nav li {
            list-style: none;
            position: absolute;
            transform-origin: 25px 375px;
            transition: 3s;
            box-shadow: 0 0 30px #000;
        }

        #nav img {
            display: block;
        }

        /*
        #nav li:nth-last-of-type(1) {
            transform: rotate(15deg);
        }
*/
    </style>
</head>

<body>

    <ul id="nav">
        <li><img src="img/img1.png" alt=""></li>
        <li><img src="img/img2.png" alt=""></li>
        <li><img src="img/img3.png" alt=""></li>
        <li><img src="img/img4.png" alt=""></li>
        <li><img src="img/img5.png" alt=""></li>
        <li><img src="img/img6.png" alt=""></li>
        <li><img src="img/img7.png" alt=""></li>
        <li><img src="img/img8.png" alt=""></li>
        <li><img src="img/img9.png" alt=""></li>
        <li><img src="img/img10.png" alt=""></li>
        <li><img src="img/img11.png" alt=""></li>
        <li><img src="img/img12.png" alt=""></li>
    </ul>

    <script>
        let nav = document.querySelectorAll("#nav li");
        let bool = true;
        nav[nav.length - 1].addEventListener('click', function () {
           flower();
        })
        function flower(){
             /*
                        0    1     2     3     4     5     6     7
                        -90  -75   -60   -45    -30  -15    0    15
            */
            for (let i = 0; i < nav.length; i++) {
                let n;
                if (bool) {
                    n = (i - nav.length / 2) * 15;
                } else {
                    n = 360;
                }
                nav[i].style.transform = 'rotate(' + n + 'deg)';
            }
            bool = !bool;
        }
    </script>
</body>

</html>